package kr.saeildamil.androidstudy.ch06;

import kr.saeildamil.androidstudy.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

public class InflationEx extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		/*
		 LinearLayout layout = new LinearLayout(this);
		 layout.setOrientation(LinearLayout.VERTICAL);
		 layout.setBackgroundColor(Color.LTGRAY);
		 
		 TextView tv = new TextView(this); tv.setText("TextView");
		 tv.setGravity(Gravity.CENTER); tv.setTextColor(Color.RED);
		 tv.setTextSize(20);
		 
		 layout.addView(tv);
		 
		 
		 setContentView(layout);
		 */

		/*
		 LayoutInflater inflator = (LayoutInflater)
		 getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		 
		 LinearLayout layout =
		 (LinearLayout)inflator.inflate(R.layout.inflation, null);
		 
		 setContentView(layout);
		 */

		/*LayoutInflater inflator = LayoutInflater.from(this);
		LinearLayout layout = (LinearLayout) inflator.inflate(
				R.layout.inflation, null);
		setContentView(layout);*/
		
		LinearLayout layout = (LinearLayout) View.inflate(this, R.layout.inflation, null);
		setContentView(layout);
	}
}
